////#include "xmlparse.h"
////#include "Parser.h"
////#include "ViewXML.h"
//#include "ListPersistent.h"
//#include "../../common/fuentes/FactoryPersistent.h"
//#include "../../common/fuentes/SampleSourcesafe.h"
//#include "../../consult/fuentes/SursafeDAO.h"
//int main()
//{
//	ListPersistent lista;
//	SampleSourcesafe * samSurface;
//	int ind,cantMuestras;
//	lista.setAtributte("date");
////	//muestra 1
//		samSurface = (SampleSourcesafe *)FactoryPersistent::getObjectFromTable("sampleSourcesafe");
//		samSurface->setStationCode("SABE");
//		samSurface->setPKSampleSourcesafe("230");
//		samSurface->setAltm("1019.0");
//		samSurface->setDate("2007-10-10");
//		samSurface->setDew("11");
//		samSurface->setDir("180");
//		samSurface->setGus("14");
//		samSurface->setHour("12:00");
//		samSurface->setRh("62");
//		samSurface->setSpd("12");
//		samSurface->setTmp("18");
//		samSurface->setVis("8.0");
//		samSurface->setWeather("R-");
//			
//		lista.insertSort(samSurface);
//	
//		//muestra 2
//		samSurface = (SampleSourcesafe *)FactoryPersistent::getObjectFromTable("sampleSourcesafe");
//		samSurface->setStationCode("SABE");
//		samSurface->setPKSampleSourcesafe("231");
//		samSurface->setAltm("999.0");
//		samSurface->setDate("2007-10-11");
//		samSurface->setDew("15");
//		samSurface->setDir("180");
//		samSurface->setGus("14");
//		samSurface->setHour("12:00");
//		samSurface->setRh("62");
//		samSurface->setSpd("12");
//		samSurface->setTmp("15");
//		samSurface->setVis("8.0");
//		samSurface->setWeather("R-");
//				
//		lista.insertSort(samSurface);
//		
//		//muestra 3
//		samSurface = (SampleSourcesafe *)FactoryPersistent::getObjectFromTable("sampleSourcesafe");
//		samSurface->setStationCode("SABE");
//		samSurface->setPKSampleSourcesafe("232");
//		samSurface->setAltm("1019.0");
//		samSurface->setDate("2007-10-12");
//		samSurface->setDew("11");
//		samSurface->setDir("180");
//		samSurface->setGus("14");
//		samSurface->setHour("12:00");
//		samSurface->setRh("62");
//		samSurface->setSpd("12");
//		samSurface->setTmp("17");
//		samSurface->setVis("8.0");
//		samSurface->setWeather("R-");
//					
//		lista.insertSort(samSurface);
//		
//		//muestra 4
//		samSurface = (SampleSourcesafe *)FactoryPersistent::getObjectFromTable("sampleSourcesafe");
//		samSurface->setStationCode("SABE");
//		samSurface->setPKSampleSourcesafe("233");
//		samSurface->setAltm("1019.0");
//		samSurface->setDate("2007-10-09");
//		samSurface->setDew("15");
//		samSurface->setDir("360");
//		samSurface->setGus("14");
//		samSurface->setHour("12:00");
//		samSurface->setRh("42");
//		samSurface->setSpd("12");
//		samSurface->setTmp("25");
//		samSurface->setVis("8.0");
//		samSurface->setWeather("R-");
//					
//		lista.insertSort(samSurface);
//		
//		//muestra 5
//		samSurface = (SampleSourcesafe *)FactoryPersistent::getObjectFromTable("sampleSourcesafe");
//		samSurface->setStationCode("SABE");
//		samSurface->setPKSampleSourcesafe("234");
//		samSurface->setAltm("1001.0");
//		samSurface->setDate("2007-10-06");
//		samSurface->setDew("11");
//		samSurface->setDir("140");
//		samSurface->setGus("14");
//		samSurface->setHour("12:00");
//		samSurface->setRh("62");
//		samSurface->setSpd("12");
//		samSurface->setTmp("18");
//		samSurface->setVis("8.0");
//		samSurface->setWeather("R-");
//					
//		lista.insertSort(samSurface);
//		
//		//muestra 6
//		samSurface = (SampleSourcesafe *)FactoryPersistent::getObjectFromTable("sampleSourcesafe");
//		samSurface->setStationCode("SARC");
//		samSurface->setPKSampleSourcesafe("235");
//		samSurface->setAltm("1015.0");
//		samSurface->setDate("2007-10-07");
//		samSurface->setDew("11");
//		samSurface->setDir("80");
//		samSurface->setGus("14");
//		samSurface->setHour("12:00");
//		samSurface->setRh("62");
//		samSurface->setSpd("12");
//		samSurface->setTmp("20");
//		samSurface->setVis("10.0");
//		samSurface->setWeather("R-");
//					
//		lista.insertSort(samSurface);
//		
//		//muestra 7
//		samSurface = (SampleSourcesafe *)FactoryPersistent::getObjectFromTable("sampleSourcesafe");
//		samSurface->setStationCode("SABE");
//		samSurface->setPKSampleSourcesafe("236");
//		samSurface->setAltm("1000.0");
//		samSurface->setDate("2007-10-01");
//		samSurface->setDew("15");
//		samSurface->setDir("10");
//		samSurface->setGus("14");
//		samSurface->setHour("12:00");
//		samSurface->setRh("82");
//		samSurface->setSpd("12");
//		samSurface->setTmp("26");
//		samSurface->setVis("8.0");
//		samSurface->setWeather("R-");
//					
//		lista.insertSort(samSurface);
//		
//		//muestra 8
//		samSurface = (SampleSourcesafe *)FactoryPersistent::getObjectFromTable("sampleSourcesafe");
//		samSurface->setStationCode("SABE");
//		samSurface->setPKSampleSourcesafe("237");
//		samSurface->setAltm("1000.0");
//		samSurface->setDate("2007-10-02");
//		samSurface->setDew("26");
//		samSurface->setDir("40");
//		samSurface->setGus("");
//		samSurface->setHour("12:00");
//		samSurface->setRh("99");
//		samSurface->setSpd("12");
//		samSurface->setTmp("27");
//		samSurface->setVis("8.0");
//		samSurface->setWeather("R-");
//				
//		lista.insertSort(samSurface);
//		
//		//muestra 9
//		samSurface = (SampleSourcesafe *)FactoryPersistent::getObjectFromTable("sampleSourcesafe");
//		samSurface->setStationCode("SABE");
//		samSurface->setPKSampleSourcesafe("238");
//		samSurface->setAltm("1019.0");
//		samSurface->setDate("2007-10-03");
//		samSurface->setDew("8");
//		samSurface->setDir("240");
//		samSurface->setGus("14");
//		samSurface->setHour("12:00");
//		samSurface->setRh("52");
//		samSurface->setSpd("12");
//		samSurface->setTmp("15");
//		samSurface->setVis("8.0");
//		samSurface->setWeather("R-");
//					
//		lista.insertSort(samSurface);
//		
//		//muestra 10
//		samSurface = (SampleSourcesafe *)FactoryPersistent::getObjectFromTable("sampleSourcesafe");
//		samSurface->setStationCode("SABE");
//		samSurface->setPKSampleSourcesafe("239");
//		samSurface->setAltm("1015.0");
//		samSurface->setDate("2007-10-05");
//		samSurface->setDew("11");
//		samSurface->setDir("270");
//		samSurface->setGus("14");
//		samSurface->setHour("12:00");
//		samSurface->setRh("62");
//		samSurface->setSpd("12");
//		samSurface->setTmp("20");
//		samSurface->setVis("8.0");
//		samSurface->setWeather("R-");
//					
//		lista.insertSort(samSurface);
//		
//		//muestra 11
//		samSurface = (SampleSourcesafe *)FactoryPersistent::getObjectFromTable("sampleSourcesafe");
//		samSurface->setStationCode("SARP");
//		samSurface->setPKSampleSourcesafe("240");
//		samSurface->setAltm("1010.0");
//		samSurface->setDate("2007-10-04");
//		samSurface->setDew("18");
//		samSurface->setDir("240");
//		samSurface->setGus("14");
//		samSurface->setHour("12:00");
//		samSurface->setRh("78");
//		samSurface->setSpd("12");
//		samSurface->setTmp("22");
//		samSurface->setVis("8.0");
//		samSurface->setWeather("R-");
//					
//		lista.insertSort(samSurface);
//		
//		//muestra 12
//		samSurface = (SampleSourcesafe *)FactoryPersistent::getObjectFromTable("sampleSourcesafe");
//		samSurface->setStationCode("SABE");
//		samSurface->setPKSampleSourcesafe("241");
//		samSurface->setAltm("1000.0");
//		samSurface->setDate("2007-10-08");
//		samSurface->setDew("24");
//		samSurface->setDir("0");
//		samSurface->setGus("14");
//		samSurface->setHour("12:00");
//		samSurface->setRh("98");
//		samSurface->setSpd("12");
//		samSurface->setTmp("26");
//		samSurface->setVis("8.0");
//		samSurface->setWeather("R-");
//					
//		lista.insertSort(samSurface);
//		
//		//muestra 13
//		samSurface = (SampleSourcesafe *)FactoryPersistent::getObjectFromTable("sampleSourcesafe");
//		samSurface->setStationCode("SABE");
//		samSurface->setPKSampleSourcesafe("242");
//		samSurface->setAltm("1009.0");
//		samSurface->setDate("2007-10-13");
//		samSurface->setDew("17");
//		samSurface->setDir("270");
//		samSurface->setGus("14");
//		samSurface->setHour("12:00");
//		samSurface->setRh("70");
//		samSurface->setSpd("12");
//		samSurface->setTmp("21");
//		samSurface->setVis("8.0");
//		samSurface->setWeather("R-");
//					
//		lista.insertSort(samSurface);
//		cantMuestras = lista.getSize();
//		std::cout<<"Tamano de la lista "<<cantMuestras<<std::endl;
//		for (ind=0;ind<cantMuestras;++ind)
//		{
//			
//			std::cout<<"Date "<<ind<<" Fecha: "<<(((SampleSourcesafe *)lista.getPersistent(ind))->getDate());
//			std::cout<<"\n";
//		}
//		std::cout<<"Test: Eliminar 1ero\n";
//		lista.erase(0);
//		cantMuestras = lista.getSize();
//		std::cout<<"Tamano de la lista "<<cantMuestras<<std::endl;
//		for (ind=0;ind<cantMuestras;++ind)
//		{
//			std::cout<<"Date "<<ind<<" Fecha: "<<((SampleSourcesafe *)lista.getPersistent(ind))->getDate();
//			std::cout<<"\n";
//		}
//		std::cout<<"Test: Eliminar 1ero\n";
//		lista.erase(0);
//		cantMuestras = lista.getSize();
//		std::cout<<"Tamano de la lista "<<cantMuestras<<std::endl;
//		for (ind=0;ind<cantMuestras;++ind)
//		{
//			std::cout<<"Date "<<ind<<" Fecha: "<<((SampleSourcesafe *)lista.getPersistent(ind))->getDate();
//			std::cout<<"\n";
//		}
//		std::cout<<"Test: Eliminar 1ero\n";
//		lista.erase(0);
//		cantMuestras = lista.getSize();
//		std::cout<<"Tamano de la lista "<<cantMuestras<<std::endl;
//		for (ind=0;ind<cantMuestras;++ind)
//		{
//			std::cout<<"Date "<<ind<<" Fecha: "<<((SampleSourcesafe *)lista.getPersistent(ind))->getDate();
//			std::cout<<"\n";
//		}
//		std::cout<<"Test: Eliminar ultimo\n";
//		lista.erase(lista.getSize()-1);
//		cantMuestras = lista.getSize();
//		std::cout<<"Tamano de la lista "<<cantMuestras<<std::endl;
//		for (ind=0;ind<cantMuestras;++ind)
//		{
//			std::cout<<"Date "<<ind<<" Fecha: "<<((SampleSourcesafe *)lista.getPersistent(ind))->getDate();
//			std::cout<<"\n";
//		}
//		std::cout<<"Test: Eliminar ultimo\n";
//		lista.erase(lista.getSize()-1);
//		cantMuestras = lista.getSize();
//		std::cout<<"Tamano de la lista "<<cantMuestras<<std::endl;
//		for (ind=0;ind<cantMuestras;++ind)
//		{
//			std::cout<<"Date "<<ind<<" Fecha: "<<((SampleSourcesafe *)lista.getPersistent(ind))->getDate();
//			std::cout<<"\n";
//		}
//		std::cout<<"Test: Eliminar ultimo\n";
//		lista.erase(lista.getSize()-1);
//		cantMuestras = lista.getSize();
//		std::cout<<"Tamano de la lista "<<cantMuestras<<std::endl;
//		for (ind=0;ind<cantMuestras;++ind)
//		{
//			std::cout<<"Date "<<ind<<" Fecha: "<<((SampleSourcesafe *)lista.getPersistent(ind))->getDate();
//			std::cout<<"\n";
//		}
//		std::cout<<"Test: Eliminar aleatorio elemento 3\n";
//		lista.erase(2);
//		cantMuestras = lista.getSize();
//		std::cout<<"Tamano de la lista "<<cantMuestras<<std::endl;
//		for (ind=0;ind<cantMuestras;++ind)
//		{
//			std::cout<<"Date "<<ind<<" Fecha: "<<((SampleSourcesafe *)lista.getPersistent(ind))->getDate();
//			std::cout<<"\n";
//		}
//		lista.sort("PKSampleSourcesafe");
//		cantMuestras = lista.getSize();
//		for (ind=0;ind<cantMuestras;++ind)
//		{
//			std::cout<<"PKSampleSourcesafe "<<ind<<" "<<((SampleSourcesafe *)lista.getPersistent(ind))->getPKSampleSourcesafe();
//			std::cout<<"\n";
//		}
//		lista.clear();
// return 0;	
//}



#include <iostream>

#include "OQLSimpleCondition.h"
#include "OQLAndCondition.h"
#include "OQLOrCondition.h"
#include "OQLSimpleCondition.h"
#include "OQLSimpleCondition.h"
#include "OQLMinCondition.h"
#include "OQLMaxCondition.h"
#include "OQLRangeCondition.h"
#include "ResolveDBRequest.h"
#include "ListPersistent.h"
#include "../../common/fuentes/Station.h"
#include "../../common/fuentes/SampleSounding.h"
#include "../../common/fuentes/SampleSourcesafe.h"
#include "../../common/fuentes/CloudLayer.h"
#include "../../common/fuentes/ConditionAtm.h"
#include "../../common/fuentes/Persistent.h"


int main()
{
	ResolveDBRequest request;
	int i = 0;
	Persistent* persistencia = NULL;
	ListPersistent lista1;
	ListPersistent lista2;
	ListPersistent lista3;
	ListPersistent lista4;
	ListPersistent lista5;
	ListPersistent lista6;
	ListPersistent lista7;
	ListPersistent lista8;
	ListPersistent lista9;
	ListPersistent lista10;
	
	Station station1;
	Station station2;
	Station station3;
	Station station4;
	Station station5;
	Station station6;
	Station station7;
	Station station8;
	Station station9;
	Station station10;
	
	SampleSounding sampleSounding1;
	SampleSounding sampleSounding2;
	SampleSounding sampleSounding3;
	SampleSounding sampleSounding4;
	SampleSounding sampleSounding5;
	SampleSounding sampleSounding6;
	SampleSounding sampleSounding7;
	SampleSounding sampleSounding8;
	SampleSounding sampleSounding9;
	SampleSounding sampleSounding10;
	
	SampleSourcesafe sampleSourcesafe1;
	SampleSourcesafe sampleSourcesafe2;
	SampleSourcesafe sampleSourcesafe3;
	SampleSourcesafe sampleSourcesafe4;
	SampleSourcesafe sampleSourcesafe5;
	SampleSourcesafe sampleSourcesafe6;
	SampleSourcesafe sampleSourcesafe7;
	SampleSourcesafe sampleSourcesafe8;
	SampleSourcesafe sampleSourcesafe9;
	SampleSourcesafe sampleSourcesafe10;
	
	ConditionAtm conditionAtm1;
	ConditionAtm conditionAtm2;
	ConditionAtm conditionAtm3;
	ConditionAtm conditionAtm4;
	ConditionAtm conditionAtm5;
	ConditionAtm conditionAtm6;
	ConditionAtm conditionAtm7;
	ConditionAtm conditionAtm8;
	ConditionAtm conditionAtm9;
	ConditionAtm conditionAtm10;
	
	CloudLayer cloudLayer1;
	CloudLayer cloudLayer2;
	CloudLayer cloudLayer3;
	CloudLayer cloudLayer4;
	CloudLayer cloudLayer5;
	CloudLayer cloudLayer6;
	CloudLayer cloudLayer7;
	CloudLayer cloudLayer8;
	CloudLayer cloudLayer9;
	CloudLayer cloudLayer10;
	
	// --------------------------------------------------------------------------
	//	CARGA DE LOS ATRIBUTOS Y ALTA DE LOS OBJETOS
	// --------------------------------------------------------------------------
	
	// Carga de los Station
	
	station1.setCode("ST1");
	station1.setNumber("1");
	station1.setLatitude("11' 23''");
	station1.setLongitude("66' 23''");
	
	station2.setCode("ST2");
	station2.setNumber("2");
	station2.setLatitude("12' 20''");
	station2.setLongitude("74' 23''");
	
	station3.setCode("ST3");
	station3.setNumber("3");
	station3.setLatitude("24' 23''");
	station3.setLongitude("66' 23''");
	
	station4.setCode("ST4");
	station4.setNumber("4");
	station4.setLatitude("27' 23''");
	station4.setLongitude("66' 23''");
	
	station5.setCode("ST5");
	station5.setNumber("5");
	station5.setLatitude("11' 01''");
	station5.setLongitude("66' 23''");
	
	station6.setCode("ST6");
	station6.setNumber("6");
	station6.setLatitude("87' 23''");
	station6.setLongitude("66' 23''");
	
	station7.setCode("ST7");
	station7.setNumber("7");
	station7.setLatitude("34' 23''");
	station7.setLongitude("66' 23''");
	
	station8.setCode("ST8");
	station8.setNumber("8");
	station8.setLatitude("91' 23''");
	station8.setLongitude("66' 23''");
	
	station9.setCode("ST9");
	station9.setNumber("9");
	station9.setLatitude("54' 23''");
	station9.setLongitude("66' 23''");
	
	station10.setCode("ST10");
	station10.setNumber("10");
	station10.setLatitude("10' 23''");
	station10.setLongitude("66' 23''");
	
	request.savePersistent("stations", &station1);
	request.savePersistent("stations", &station1);
	request.savePersistent("stations", &station2);
	request.savePersistent("stations", &station3);
	request.savePersistent("stations", &station4);
	request.savePersistent("stations", &station5);
	request.savePersistent("stations", &station6);
	request.savePersistent("stations", &station7);
	request.savePersistent("stations", &station8);
	request.savePersistent("stations", &station9);
	request.savePersistent("stations", &station10);
	
	// Carga de los SampleSounding
	
	sampleSounding1.setBulk_richardson("bulk1");
	sampleSounding1.setCape("cape1");
	sampleSounding1.setCape_virtual("capev1");
	sampleSounding1.setConvective_inhibition("conv1");
	sampleSounding1.setCross_totals_index("cross1");
	sampleSounding1.setDate("");
	sampleSounding1.setHour("hour1");
	sampleSounding1.setK_index("index1");
	sampleSounding1.setLifted("lifted1");
	sampleSounding1.setLifted_virtual("liftedv1");
	sampleSounding1.setPrecipitable_water("prec1");
	sampleSounding1.setShowalter_index("show1");
	sampleSounding1.setSweat_index("sweat1");
	sampleSounding1.setTotals_totals_index("totali1");
	sampleSounding1.setVertical_totals_index("vtotali1");
	sampleSounding1.setStationCode("code1");
	
	sampleSounding2.setBulk_richardson("bulk2");
	sampleSounding2.setCape("cape2");
	sampleSounding2.setCape_virtual("capev2");
	sampleSounding2.setConvective_inhibition("conv2");
	sampleSounding2.setCross_totals_index("cross2");
	sampleSounding2.setDate("");
	sampleSounding2.setHour("hour2");
	sampleSounding2.setK_index("index2");
	sampleSounding2.setLifted("lifted2");
	sampleSounding2.setLifted_virtual("liftedv2");
	sampleSounding2.setPrecipitable_water("prec2");
	sampleSounding2.setShowalter_index("show2");
	sampleSounding2.setSweat_index("sweat2");
	sampleSounding2.setTotals_totals_index("totali2");
	sampleSounding2.setVertical_totals_index("vtotali2");
	sampleSounding2.setStationCode("code2");
	
	sampleSounding3.setBulk_richardson("bulk3");
	sampleSounding3.setCape("cape3");
	sampleSounding3.setCape_virtual("capev3");
	sampleSounding3.setConvective_inhibition("conv3");
	sampleSounding3.setCross_totals_index("cross3");
	sampleSounding3.setDate("");
	sampleSounding3.setHour("hour3");
	sampleSounding3.setK_index("index3");
	sampleSounding3.setLifted("lifted3");
	sampleSounding3.setLifted_virtual("liftedv3");
	sampleSounding3.setPrecipitable_water("prec3");
	sampleSounding3.setShowalter_index("show3");
	sampleSounding3.setSweat_index("sweat3");
	sampleSounding3.setTotals_totals_index("totali3");
	sampleSounding3.setVertical_totals_index("vtotali3");
	sampleSounding3.setStationCode("code3");
	
	sampleSounding4.setBulk_richardson("bulk4");
	sampleSounding4.setCape("cape4");
	sampleSounding4.setCape_virtual("capev4");
	sampleSounding4.setConvective_inhibition("conv4");
	sampleSounding4.setCross_totals_index("cross4");
	sampleSounding4.setDate("");
	sampleSounding4.setHour("hour4");
	sampleSounding4.setK_index("index4");
	sampleSounding4.setLifted("lifted4");
	sampleSounding4.setLifted_virtual("liftedv4");
	sampleSounding4.setPrecipitable_water("prec4");
	sampleSounding4.setShowalter_index("show4");
	sampleSounding4.setSweat_index("sweat4");
	sampleSounding4.setTotals_totals_index("totali4");
	sampleSounding4.setVertical_totals_index("vtotali4");
	sampleSounding4.setStationCode("code4");
	
	sampleSounding5.setBulk_richardson("bulk5");
	sampleSounding5.setCape("cape5");
	sampleSounding5.setCape_virtual("capev5");
	sampleSounding5.setConvective_inhibition("conv5");
	sampleSounding5.setCross_totals_index("cross5");
	sampleSounding5.setDate("2007-04-22");
	sampleSounding5.setHour("hour5");
	sampleSounding5.setK_index("index5");
	sampleSounding5.setLifted("lifted5");
	sampleSounding5.setLifted_virtual("liftedv5");
	sampleSounding5.setPrecipitable_water("prec5");
	sampleSounding5.setShowalter_index("show5");
	sampleSounding5.setSweat_index("sweat5");
	sampleSounding5.setTotals_totals_index("totali5");
	sampleSounding5.setVertical_totals_index("vtotali5");
	sampleSounding5.setStationCode("code5");
	
	sampleSounding6.setBulk_richardson("bulk6");
	sampleSounding6.setCape("cape6");
	sampleSounding6.setCape_virtual("capev6");
	sampleSounding6.setConvective_inhibition("conv6");
	sampleSounding6.setCross_totals_index("cross6");
	sampleSounding6.setDate("2007-05-30");
	sampleSounding6.setHour("hour6");
	sampleSounding6.setK_index("index6");
	sampleSounding6.setLifted("lifted6");
	sampleSounding6.setLifted_virtual("liftedv6");
	sampleSounding6.setPrecipitable_water("prec6");
	sampleSounding6.setShowalter_index("show6");
	sampleSounding6.setSweat_index("sweat6");
	sampleSounding6.setTotals_totals_index("totali6");
	sampleSounding6.setVertical_totals_index("vtotali6");
	sampleSounding6.setStationCode("code6");
	
	sampleSounding7.setBulk_richardson("bulk7");
	sampleSounding7.setCape("cape7");
	sampleSounding7.setCape_virtual("capev7");
	sampleSounding7.setConvective_inhibition("conv7");
	sampleSounding7.setCross_totals_index("cross7");
	sampleSounding7.setDate("2007-06-01");
	sampleSounding7.setHour("hour7");
	sampleSounding7.setK_index("index7");
	sampleSounding7.setLifted("lifted7");
	sampleSounding7.setLifted_virtual("liftedv7");
	sampleSounding7.setPrecipitable_water("prec7");
	sampleSounding7.setShowalter_index("show7");
	sampleSounding7.setSweat_index("sweat7");
	sampleSounding7.setTotals_totals_index("totali7");
	sampleSounding7.setVertical_totals_index("vtotali7");
	sampleSounding7.setStationCode("code7");
	
	sampleSounding8.setBulk_richardson("bulk8");
	sampleSounding8.setCape("cape8");
	sampleSounding8.setCape_virtual("capev8");
	sampleSounding8.setConvective_inhibition("conv8");
	sampleSounding8.setCross_totals_index("cross8");
	sampleSounding8.setDate("2007-07-20");
	sampleSounding8.setHour("hour8");
	sampleSounding8.setK_index("index8");
	sampleSounding8.setLifted("lifted8");
	sampleSounding8.setLifted_virtual("liftedv8");
	sampleSounding8.setPrecipitable_water("prec8");
	sampleSounding8.setShowalter_index("show8");
	sampleSounding8.setSweat_index("sweat8");
	sampleSounding8.setTotals_totals_index("totali8");
	sampleSounding8.setVertical_totals_index("vtotali8");
	sampleSounding8.setStationCode("code8");
	
	sampleSounding9.setBulk_richardson("bulk9");
	sampleSounding9.setCape("cape9");
	sampleSounding9.setCape_virtual("capev9");
	sampleSounding9.setConvective_inhibition("conv9");
	sampleSounding9.setCross_totals_index("cross9");
	sampleSounding9.setDate("2007-08-05");
	sampleSounding9.setHour("hour9");
	sampleSounding9.setK_index("index9");
	sampleSounding9.setLifted("lifted9");
	sampleSounding9.setLifted_virtual("liftedv9");
	sampleSounding9.setPrecipitable_water("prec9");
	sampleSounding9.setShowalter_index("show9");
	sampleSounding9.setSweat_index("sweat9");
	sampleSounding9.setTotals_totals_index("totali9");
	sampleSounding9.setVertical_totals_index("vtotali9");
	sampleSounding9.setStationCode("code9");
	
	sampleSounding10.setBulk_richardson("bulk10");
	sampleSounding10.setCape("cape10");
	sampleSounding10.setCape_virtual("capev10");
	sampleSounding10.setConvective_inhibition("conv10");
	sampleSounding10.setCross_totals_index("cross10");
	sampleSounding10.setDate("2007-11-20");
	sampleSounding10.setHour("hour10");
	sampleSounding10.setK_index("index10");
	sampleSounding10.setLifted("lifted10");
	sampleSounding10.setLifted_virtual("liftedv10");
	sampleSounding10.setPrecipitable_water("prec10");
	sampleSounding10.setShowalter_index("show10");
	sampleSounding10.setSweat_index("sweat10");
	sampleSounding10.setTotals_totals_index("totali10");
	sampleSounding10.setVertical_totals_index("vtotali10");
	sampleSounding10.setStationCode("code10");
	
	request.savePersistent("sampleSounding", &sampleSounding1);
	request.savePersistent("sampleSounding", &sampleSounding2);
	request.savePersistent("sampleSounding", &sampleSounding3);
	request.savePersistent("sampleSounding", &sampleSounding4);
	request.savePersistent("sampleSounding", &sampleSounding5);
	request.savePersistent("sampleSounding", &sampleSounding6);
	request.savePersistent("sampleSounding", &sampleSounding7);
	request.savePersistent("sampleSounding", &sampleSounding8);
	request.savePersistent("sampleSounding", &sampleSounding9);
	request.savePersistent("sampleSounding", &sampleSounding10);
	request.savePersistent("sampleSounding", &sampleSounding8);
	
	// Carga de los SampleSourcesafe
	
	sampleSourcesafe1.setStationCode("ST1");
	sampleSourcesafe1.setAltm("altm1");
	sampleSourcesafe1.setDate("date1");
	sampleSourcesafe1.setDir("di1");
	sampleSourcesafe1.setDew("d1");
	sampleSourcesafe1.setGus("gus1");
	sampleSourcesafe1.setHour("hour1");
	sampleSourcesafe1.setRh("rh1");
	sampleSourcesafe1.setSpd("ps1");
	sampleSourcesafe1.setTmp("tm1");
	sampleSourcesafe1.setVis("vis1");
	sampleSourcesafe1.setWeather("wheather1");
	
	sampleSourcesafe2.setStationCode("ST2");
	sampleSourcesafe2.setAltm("altm2");
	sampleSourcesafe2.setDate("date2");
	sampleSourcesafe2.setDir("di2");
	sampleSourcesafe2.setDew("d2");
	sampleSourcesafe2.setGus("gus2");
	sampleSourcesafe2.setHour("hour2");
	sampleSourcesafe2.setRh("rh2");
	sampleSourcesafe2.setSpd("ps2");
	sampleSourcesafe2.setTmp("tm2");
	sampleSourcesafe2.setVis("vis2");
	sampleSourcesafe2.setWeather("wheather2");
	
	sampleSourcesafe3.setStationCode("ST3");
	sampleSourcesafe3.setAltm("altm3");
	sampleSourcesafe3.setDate("date3");
	sampleSourcesafe3.setDir("di3");
	sampleSourcesafe3.setDew("d3");
	sampleSourcesafe3.setGus("gus3");
	sampleSourcesafe3.setHour("hour3");
	sampleSourcesafe3.setRh("rh3");
	sampleSourcesafe3.setSpd("ps3");
	sampleSourcesafe3.setTmp("tm3");
	sampleSourcesafe3.setVis("vis3");
	sampleSourcesafe3.setWeather("wheather3");
	
	sampleSourcesafe4.setStationCode("ST4");
	sampleSourcesafe4.setAltm("altm4");
	sampleSourcesafe4.setDate("date4");
	sampleSourcesafe4.setDir("di4");
	sampleSourcesafe4.setDew("d4");
	sampleSourcesafe4.setGus("gus4");
	sampleSourcesafe4.setHour("hour4");
	sampleSourcesafe4.setRh("rh4");
	sampleSourcesafe4.setSpd("ps4");
	sampleSourcesafe4.setTmp("tm4");
	sampleSourcesafe4.setVis("vis4");
	sampleSourcesafe4.setWeather("wheather4");
	
	sampleSourcesafe5.setStationCode("ST5");
	sampleSourcesafe5.setAltm("altm5");
	sampleSourcesafe5.setDate("date5");
	sampleSourcesafe5.setDir("di5");
	sampleSourcesafe5.setDew("d5");
	sampleSourcesafe5.setGus("gus5");
	sampleSourcesafe5.setHour("hour5");
	sampleSourcesafe5.setRh("rh5");
	sampleSourcesafe5.setSpd("ps5");
	sampleSourcesafe5.setTmp("tm5");
	sampleSourcesafe5.setVis("vis5");
	sampleSourcesafe5.setWeather("wheather5");
	
	sampleSourcesafe6.setStationCode("ST6");
	sampleSourcesafe6.setAltm("altm6");
	sampleSourcesafe6.setDate("date6");
	sampleSourcesafe6.setDir("di6");
	sampleSourcesafe6.setDew("d6");
	sampleSourcesafe6.setGus("gus6");
	sampleSourcesafe6.setHour("hour6");
	sampleSourcesafe6.setRh("rh6");
	sampleSourcesafe6.setSpd("ps6");
	sampleSourcesafe6.setTmp("tm6");
	sampleSourcesafe6.setVis("vis6");
	sampleSourcesafe6.setWeather("wheather6");
	
	sampleSourcesafe7.setStationCode("ST7");
	sampleSourcesafe7.setAltm("altm7");
	sampleSourcesafe7.setDate("date7");
	sampleSourcesafe7.setDir("di7");
	sampleSourcesafe7.setDew("d7");
	sampleSourcesafe7.setGus("gus7");
	sampleSourcesafe7.setHour("hour7");
	sampleSourcesafe7.setRh("rh7");
	sampleSourcesafe7.setSpd("ps7");
	sampleSourcesafe7.setTmp("tm7");
	sampleSourcesafe7.setVis("vis7");
	sampleSourcesafe7.setWeather("wheather7");
	
	sampleSourcesafe8.setStationCode("ST8");
	sampleSourcesafe8.setAltm("altm8");
	sampleSourcesafe8.setDate("date8");
	sampleSourcesafe8.setDir("di8");
	sampleSourcesafe8.setDew("d8");
	sampleSourcesafe8.setGus("gus8");
	sampleSourcesafe8.setHour("hour8");
	sampleSourcesafe8.setRh("rh8");
	sampleSourcesafe8.setSpd("ps8");
	sampleSourcesafe8.setTmp("tm8");
	sampleSourcesafe8.setVis("vis8");
	sampleSourcesafe8.setWeather("wheather8");
	
	sampleSourcesafe9.setStationCode("ST9");
	sampleSourcesafe9.setAltm("altm9");
	sampleSourcesafe9.setDate("date9");
	sampleSourcesafe9.setDir("di9");
	sampleSourcesafe9.setDew("d9");
	sampleSourcesafe9.setGus("gus9");
	sampleSourcesafe9.setHour("hour9");
	sampleSourcesafe9.setRh("rh9");
	sampleSourcesafe9.setSpd("ps9");
	sampleSourcesafe9.setTmp("tm9");
	sampleSourcesafe9.setVis("vis9");
	sampleSourcesafe9.setWeather("wheather9");
	
	sampleSourcesafe10.setStationCode("ST10");
	sampleSourcesafe10.setAltm("altm10");
	sampleSourcesafe10.setDate("date10");
	sampleSourcesafe10.setDir("di10");
	sampleSourcesafe10.setDew("d10");
	sampleSourcesafe10.setGus("gus10");
	sampleSourcesafe10.setHour("hour10");
	sampleSourcesafe10.setRh("rh10");
	sampleSourcesafe10.setSpd("ps10");
	sampleSourcesafe10.setTmp("tm10");
	sampleSourcesafe10.setVis("vis10");
	sampleSourcesafe10.setWeather("wheather10");
	
	request.savePersistent("sampleSourcesafe", &sampleSourcesafe1);
	request.savePersistent("sampleSourcesafe", &sampleSourcesafe2);
	request.savePersistent("sampleSourcesafe", &sampleSourcesafe3);
	request.savePersistent("sampleSourcesafe", &sampleSourcesafe4);
	request.savePersistent("sampleSourcesafe", &sampleSourcesafe5);
	request.savePersistent("sampleSourcesafe", &sampleSourcesafe6);
	request.savePersistent("sampleSourcesafe", &sampleSourcesafe7);
	request.savePersistent("sampleSourcesafe", &sampleSourcesafe8);
	request.savePersistent("sampleSourcesafe", &sampleSourcesafe9);
	request.savePersistent("sampleSourcesafe", &sampleSourcesafe10);
	
	// Cargo los ConditionAtm
	
	conditionAtm1.setDrct("drct1");
	conditionAtm1.setDwpt("dwpt1");
	conditionAtm1.setHght("hght1");
	conditionAtm1.setMixr("mixr1");
	conditionAtm1.setPres("pres1");
	conditionAtm1.setRelh("relh1");
	conditionAtm1.setSampleCode(sampleSounding1.getPKSampleSounding());
	conditionAtm1.setSknt("sknt1");
	conditionAtm1.setTemp("temp1");
	conditionAtm1.setThta("thta1");
	conditionAtm1.setThte("thte1");
	conditionAtm1.setThtv("thtv1");
	conditionAtm1.setDate("date1");
	conditionAtm1.setStationCode("ST1");
	
	conditionAtm2.setDrct("drct2");
	conditionAtm2.setDwpt("dwpt2");
	conditionAtm2.setHght("hght2");
	conditionAtm2.setMixr("mixr2");
	conditionAtm2.setPres("pres2");
	conditionAtm2.setRelh("relh2");
	conditionAtm2.setSampleCode(sampleSounding2.getPKSampleSounding());
	conditionAtm2.setSknt("sknt2");
	conditionAtm2.setTemp("temp2");
	conditionAtm2.setThta("thta2");
	conditionAtm2.setThte("thte2");
	conditionAtm2.setThtv("thtv2");
	conditionAtm2.setDate("date2");
	conditionAtm2.setStationCode("ST2");
	
	conditionAtm3.setDrct("drct3");
	conditionAtm3.setDwpt("dwpt3");
	conditionAtm3.setHght("hght3");
	conditionAtm3.setMixr("mixr3");
	conditionAtm3.setPres("pres3");
	conditionAtm3.setRelh("relh3");
	conditionAtm3.setSampleCode(sampleSounding3.getPKSampleSounding());
	conditionAtm3.setSknt("sknt3");
	conditionAtm3.setTemp("temp3");
	conditionAtm3.setThta("thta3");
	conditionAtm3.setThte("thte3");
	conditionAtm3.setThtv("thtv3");
	conditionAtm3.setDate("date3");
	conditionAtm3.setStationCode("ST3");
	
	conditionAtm4.setDrct("drct4");
	conditionAtm4.setDwpt("dwpt4");
	conditionAtm4.setHght("hght4");
	conditionAtm4.setMixr("mixr4");
	conditionAtm4.setPres("pres4");
	conditionAtm4.setRelh("relh4");
	conditionAtm4.setSampleCode(sampleSounding4.getPKSampleSounding());
	conditionAtm4.setSknt("sknt4");
	conditionAtm4.setTemp("temp4");
	conditionAtm4.setThta("thta4");
	conditionAtm4.setThte("thte4");
	conditionAtm4.setThtv("thtv4");
	conditionAtm4.setDate("date4");
	conditionAtm4.setStationCode("ST4");
	
	conditionAtm5.setDrct("drct5");
	conditionAtm5.setDwpt("dwpt5");
	conditionAtm5.setHght("hght5");
	conditionAtm5.setMixr("mixr5");
	conditionAtm5.setPres("pres5");
	conditionAtm5.setRelh("relh5");
	conditionAtm5.setSampleCode(sampleSounding5.getPKSampleSounding());
	conditionAtm5.setSknt("sknt5");
	conditionAtm5.setTemp("temp5");
	conditionAtm5.setThta("thta5");
	conditionAtm5.setThte("thte5");
	conditionAtm5.setThtv("thtv5");
	conditionAtm5.setDate("date5");
	conditionAtm5.setStationCode("ST5");
	
	conditionAtm6.setDrct("drct6");
	conditionAtm6.setDwpt("dwpt6");
	conditionAtm6.setHght("hght6");
	conditionAtm6.setMixr("mixr6");
	conditionAtm6.setPres("pres6");
	conditionAtm6.setRelh("relh6");
	conditionAtm6.setSampleCode(sampleSounding6.getPKSampleSounding());
	conditionAtm6.setSknt("sknt6");
	conditionAtm6.setTemp("temp6");
	conditionAtm6.setThta("thta6");
	conditionAtm6.setThte("thte6");
	conditionAtm6.setThtv("thtv6");
	conditionAtm6.setDate("date6");
	conditionAtm6.setStationCode("ST6");
	
	conditionAtm7.setDrct("drct7");
	conditionAtm7.setDwpt("dwpt7");
	conditionAtm7.setHght("hght7");
	conditionAtm7.setMixr("mixr7");
	conditionAtm7.setPres("pres7");
	conditionAtm7.setRelh("relh7");
	conditionAtm7.setSampleCode(sampleSounding7.getPKSampleSounding());
	conditionAtm7.setSknt("sknt7");
	conditionAtm7.setTemp("temp7");
	conditionAtm7.setThta("thta7");
	conditionAtm7.setThte("thte7");
	conditionAtm7.setThtv("thtv7");
	conditionAtm7.setDate("date7");
	conditionAtm7.setStationCode("ST7");
	
	conditionAtm8.setDrct("drct8");
	conditionAtm8.setDwpt("dwpt8");
	conditionAtm8.setHght("hght8");
	conditionAtm8.setMixr("mixr8");
	conditionAtm8.setPres("pres8");
	conditionAtm8.setRelh("relh8");
	conditionAtm8.setSampleCode(sampleSounding8.getPKSampleSounding());
	conditionAtm8.setSknt("sknt8");
	conditionAtm8.setTemp("temp8");
	conditionAtm8.setThta("thta8");
	conditionAtm8.setThte("thte8");
	conditionAtm8.setThtv("thtv8");
	conditionAtm8.setDate("date8");
	conditionAtm8.setStationCode("ST8");
	
	conditionAtm9.setDrct("drct9");
	conditionAtm9.setDwpt("dwpt9");
	conditionAtm9.setHght("hght9");
	conditionAtm9.setMixr("mixr9");
	conditionAtm9.setPres("pres9");
	conditionAtm9.setRelh("relh9");
	conditionAtm9.setSampleCode(sampleSounding9.getPKSampleSounding());
	conditionAtm9.setSknt("sknt9");
	conditionAtm9.setTemp("temp9");
	conditionAtm9.setThta("thta9");
	conditionAtm9.setThte("thte9");
	conditionAtm9.setThtv("thtv9");
	conditionAtm9.setDate("date9");
	conditionAtm9.setStationCode("ST9");
	
	conditionAtm10.setDrct("drct10");
	conditionAtm10.setDwpt("dwpt10");
	conditionAtm10.setHght("hght10");
	conditionAtm10.setMixr("mixr10");
	conditionAtm10.setPres("pres10");
	conditionAtm10.setRelh("relh10");
	conditionAtm10.setSampleCode(sampleSounding10.getPKSampleSounding());
	conditionAtm10.setSknt("sknt10");
	conditionAtm10.setTemp("temp10");
	conditionAtm10.setThta("thta10");
	conditionAtm10.setThte("thte10");
	conditionAtm10.setThtv("thtv10");
	conditionAtm10.setDate("date10");
	conditionAtm10.setStationCode("ST10");
	
	request.savePersistent("conditionAtm", &conditionAtm1);
	request.savePersistent("conditionAtm", &conditionAtm2);
	request.savePersistent("conditionAtm", &conditionAtm3);
	request.savePersistent("conditionAtm", &conditionAtm4);
	request.savePersistent("conditionAtm", &conditionAtm5);
	request.savePersistent("conditionAtm", &conditionAtm6);
	request.savePersistent("conditionAtm", &conditionAtm7);
	request.savePersistent("conditionAtm", &conditionAtm8);
	request.savePersistent("conditionAtm", &conditionAtm9);
	request.savePersistent("conditionAtm", &conditionAtm10);
	
	// Carga del Cloudlayer
	
	cloudLayer1.setHeight("h1");
	cloudLayer1.setType("t1");
	cloudLayer1.setSampleCode(sampleSourcesafe1.getPKSampleSourcesafe());
	cloudLayer1.setDate("date1");
	cloudLayer1.setStationCode("ST1");
	
	cloudLayer2.setHeight("h2");
	cloudLayer2.setType("t2");
	cloudLayer2.setSampleCode(sampleSourcesafe2.getPKSampleSourcesafe());
	cloudLayer2.setDate("date2");
	cloudLayer2.setStationCode("ST2");
	
	cloudLayer3.setHeight("h3");
	cloudLayer3.setType("t3");
	cloudLayer3.setSampleCode(sampleSourcesafe3.getPKSampleSourcesafe());
	cloudLayer3.setDate("date3");
	cloudLayer3.setStationCode("ST3");
	
	cloudLayer4.setHeight("h4");
	cloudLayer4.setType("t4");
	cloudLayer4.setSampleCode(sampleSourcesafe4.getPKSampleSourcesafe());
	cloudLayer4.setDate("date4");
	cloudLayer4.setStationCode("ST4");
	
	cloudLayer5.setHeight("h5");
	cloudLayer5.setType("t5");
	cloudLayer5.setSampleCode(sampleSourcesafe5.getPKSampleSourcesafe());
	cloudLayer5.setDate("date5");
	cloudLayer5.setStationCode("ST5");
	
	cloudLayer6.setHeight("h6");
	cloudLayer6.setType("t6");
	cloudLayer6.setSampleCode(sampleSourcesafe6.getPKSampleSourcesafe());
	cloudLayer6.setDate("date6");
	cloudLayer6.setStationCode("ST6");
	
	cloudLayer7.setHeight("h7");
	cloudLayer7.setType("t7");
	cloudLayer7.setSampleCode(sampleSourcesafe7.getPKSampleSourcesafe());
	cloudLayer7.setDate("date7");
	cloudLayer7.setStationCode("ST7");
	
	cloudLayer8.setHeight("h8");
	cloudLayer8.setType("t8");
	cloudLayer8.setSampleCode(sampleSourcesafe8.getPKSampleSourcesafe());
	cloudLayer8.setDate("date8");
	cloudLayer8.setStationCode("ST8");
	
	cloudLayer9.setHeight("h9");
	cloudLayer9.setType("t9");
	cloudLayer9.setSampleCode(sampleSourcesafe9.getPKSampleSourcesafe());
	cloudLayer9.setDate("date9");
	cloudLayer9.setStationCode("ST9");
	
	cloudLayer10.setHeight("h10");
	cloudLayer10.setType("t10");
	cloudLayer10.setSampleCode(sampleSourcesafe10.getPKSampleSourcesafe());
	cloudLayer10.setDate("date10");
	cloudLayer10.setStationCode("ST10");
	
	request.savePersistent("cloudsLayer", &cloudLayer1);
	request.savePersistent("cloudsLayer", &cloudLayer2);
	request.savePersistent("cloudsLayer", &cloudLayer3);
	request.savePersistent("cloudsLayer", &cloudLayer4);
	request.savePersistent("cloudsLayer", &cloudLayer5);
	request.savePersistent("cloudsLayer", &cloudLayer6);
	request.savePersistent("cloudsLayer", &cloudLayer7);
	request.savePersistent("cloudsLayer", &cloudLayer8);
	request.savePersistent("cloudsLayer", &cloudLayer9);
	request.savePersistent("cloudsLayer", &cloudLayer10);
	
	// --------------------------------------------------------------------------
	//	CONSULTA SIMPLE
	// --------------------------------------------------------------------------
	
	OQLSimpleCondition simple1;
	OQLSimpleCondition simple2;
	OQLSimpleCondition simple3;
	OQLSimpleCondition simple4;
	OQLSimpleCondition simple5;
	OQLSimpleCondition simple6;
	OQLSimpleCondition simple7;
	OQLSimpleCondition simple8;
	OQLSimpleCondition simple9;
	OQLSimpleCondition simple10;
	OQLSimpleCondition simple11;
	OQLSimpleCondition simple12;
	
	simple1.setAttribute(Station::NUMBER);
	simple1.setOperator("<");
	simple1.setValue("5");
	simple1.setTable("stations");
	
	simple2.setAttribute(Station::LATITUDE);
	simple2.setOperator("<");
	simple2.setValue("19' 23''");
	simple2.setTable("stations");
	
	simple3.setAttribute(SampleSounding::DATE);
	simple3.setOperator("<");
	simple3.setValue("date5");
	simple3.setTable("sampleSounding");
	
	simple4.setAttribute(SampleSounding::LIFTED);
	simple4.setOperator("<=");
	simple4.setValue("lifted5");
	simple4.setTable("sampleSounding");
	
	simple5.setAttribute(SampleSourcesafe::DEW);
	simple5.setOperator(">=");
	simple5.setValue("d2");
	simple5.setTable("sampleSourcesafe");
	
	simple6.setAttribute(SampleSourcesafe::CODE);
	simple6.setOperator("=");
	simple6.setValue("ST4");
	simple6.setTable("sampleSourcesafe");
	
	simple7.setAttribute(ConditionAtm::HGHT);
	simple7.setOperator("<");
	simple7.setValue("hght4");
	simple7.setTable("conditionAtm");
	
	simple8.setAttribute(ConditionAtm::CODE);
	simple8.setOperator("<");
	simple8.setValue("ST3");
	simple8.setTable("conditionAtm");
	
	simple9.setAttribute(CloudLayer::TYPE);
	simple9.setOperator("<=");
	simple9.setValue("t4");
	simple9.setTable("cloudsLayer");
	
	simple10.setAttribute(CloudLayer::DATE);
	simple10.setOperator("=");
	simple10.setValue("date5");
	simple10.setTable("cloudsLayer");
	
	simple11.setAttribute(CloudLayer::DATE);
	simple11.setOperator(">=");
	simple11.setValue("date3");
	simple11.setTable("cloudsLayer");
		
	simple12.setAttribute(CloudLayer::DATE);
	simple12.setOperator("=");
	simple12.setValue("date7");
	simple12.setTable("cloudsLayer");
	
	lista1 = request.resolveSimple(simple1);
	
	for(i = 0; i < lista1.getSize(); i++)
	{
		persistencia = lista1.getPersistent(i);
		persistencia->print();
	}
	lista1.clear();
	
	lista2 = request.resolveSimple(simple2);
	
	for(i = 0; i < lista2.getSize(); i++)
	{
		persistencia = lista2.getPersistent(i);
		persistencia->print();
	}
	lista2.clear();
	
	OQLAndCondition condAnd;
	condAnd.addCondition(&simple1);
	condAnd.addCondition(&simple2);
	
	lista3 = request.resolveAnd(condAnd);
	
	for(i = 0; i < lista3.getSize(); i++)
	{
		persistencia = lista3.getPersistent(i);
		persistencia->print();
	}
	lista3.clear();
	
	OQLOrCondition condOr;
	condOr.addCondition(&simple1);
	condOr.addCondition(&simple2);
	
	lista3 = request.resolveOr(condOr);
	
	for(i = 0; i < lista3.getSize(); i++)
	{
		persistencia = lista3.getPersistent(i);
		persistencia->print();
	}
	lista3.clear();
	
	
	OQLMaxCondition opMax;
	opMax.setAttribute(Station::NUMBER);
	opMax.setTable("stations");
	
	lista3 = opMax.resolve(NULL);
	
	for(i = 0; i < lista3.getSize(); i++)
	{
		persistencia = lista3.getPersistent(i);
		persistencia->print();
	}
	lista3.clear();
	
	OQLSimpleCondition simpleMin;
		
	simpleMin.setAttribute(SampleSounding::CAPE);
	simpleMin.setOperator(">");
	simpleMin.setValue("cape2");
	simpleMin.setTable("sampleSounding");
		
	OQLMinCondition opMin;
	opMin.setAttribute(SampleSounding::DATE);
	opMin.setTable("sampleSounding");
	
	lista3 = opMin.resolve(&simpleMin);
	
	for(i = 0; i < lista3.getSize(); i++)
	{
		persistencia = lista3.getPersistent(i);
		persistencia->print();
	}
	lista3.clear();
	
	OQLMediaCondition opMedia;
	opMedia.setAttribute(Station::NUMBER);
	opMedia.setTable("stations");
	
	double result =  request.resolveMedia(opMedia);
	
	std::cout << "resultado media: " << result << "\n";

	
	lista3 = request.resolveSimple(simple3);
	
	for(i = 0; i < lista3.getSize(); i++)
	{
		persistencia = lista3.getPersistent(i);
		persistencia->print();
	}
	lista3.clear();
	
	lista4 = request.resolveSimple(simple4);
	
	for(i = 0; i < lista4.getSize(); i++)
	{
		persistencia = lista4.getPersistent(i);
		persistencia->print();
	}
	lista4.clear();
	
	lista5 = request.resolveSimple(simple5);
	
	for(i = 0; i < lista5.getSize(); i++)
	{
		persistencia = lista5.getPersistent(i);
		persistencia->print();
	}
	lista5.clear();
	
	lista6 = request.resolveSimple(simple6);
	
	for(i = 0; i < lista6.getSize(); i++)
	{
		persistencia = lista6.getPersistent(i);
		persistencia->print();
	}
	lista6.clear();
	
	lista7 = request.resolveSimple(simple7);
	
	for(i = 0; i < lista7.getSize(); i++)
	{
		persistencia = lista7.getPersistent(i);
		persistencia->print();
	}
	lista7.clear();
	
	lista8 = request.resolveSimple(simple8);
	
	for(i = 0; i < lista8.getSize(); i++)
	{
		persistencia = lista8.getPersistent(i);
		persistencia->print();
	}
	lista8.clear();
	
	lista9 = request.resolveSimple(simple9);
	
	for(i = 0; i < lista9.getSize(); i++)
	{
		persistencia = lista9.getPersistent(i);
		persistencia->print();
	}
	lista9.clear();
	
	lista10 = request.resolveSimple(simple10);
	
	for(i = 0; i < lista10.getSize(); i++)
	{
		persistencia = lista10.getPersistent(i);
		persistencia->print();
	}
	lista10.clear();
	
	// Testing de la consulta por rangos
	std::cout << std::endl << "CONSULTA POR RANGOS: tiene que devolver los date3 al date7 de los cloudlayer" << std::endl << std::endl;
	
	OQLRangeCondition range;
	
	range.addCondition(&simple11);
	range.addCondition(&simple12);
	
	lista10 = range.resolve(simple11.getTable());
	
	for(i = 0; i < lista10.getSize(); i++)
	{
		persistencia = lista10.getPersistent(i);
		persistencia->print();
	}
	lista10.clear();
	return 0;
}
